package com.tomehay.termprojectmanage_server.controller;


import com.tomehay.termprojectmanage_server.pojo.Model.TaskGrades;
import com.tomehay.termprojectmanage_server.pojo.VO.ResultVO;
import com.tomehay.termprojectmanage_server.service.TaskGradesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
@RestController
@RequestMapping("api/taskGrades")
public class TaskGradesController {

    @Autowired
    TaskGradesService taskGradesService;

    @GetMapping("/ScoreTask")
    public ResultVO<Void> ScoreTask(int Score,int id){
        return taskGradesService.ScoreTask(Score,id);
    }

    @GetMapping("/GetScore")
    public ResultVO<Integer> GetScore(int id){
        return taskGradesService.GetScore(id);
    }

    @GetMapping("/GetByCourseId")
    public ResultVO<List<TaskGrades>> getByCourseID(int course_id){
        return taskGradesService.getByCourseID(course_id);
    }
}
